<?php
namespace app\common\validate\order;
use think\Validate;
/**
 * 订单管理验证器
 */
class ShopOrderValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'ids' => ['require', 'array'],
        'id' => 'require',
        'title' => 'require',
        'content' => 'require',
        'is_disable' => ['require', 'in' => '0,1'],
        'auth_status' => ['require', 'in' => '1,2'],
        'member_account_ids' => ['require', 'array'],
        'shop_product_enter_id' => 'require',
        'enter_type' => ['require', 'in' => '0,1,2,3'],
        'shop_order_id'=> 'require',
        'setting_price_range_id'=> 'require',
        'comment_status'=> ['require', 'in' => '2,3'],
        'comment_type'=> ['require', 'in' => '2,3,4'],
        'mer_refund_status'=> ['require', 'in' => '0,1,2,3'],
        'member_id'=> 'require',
        'actual_amount'=> 'require',
        'logistics_image_id'=>'require',
        'member_account_id'=>'require',
        'order_comment_id'=>'require',
        'evaluate_image_id'=>'require',
        'status'=>'require',
        'object'=>'require',
        'principal'=>'require',
        'commission'=>'require',
        'shop_product_id'=>'require',
    ];
    // 错误信息
    protected $message = [
        'auth_status.require' => '请选择审核状态',
        'shop_product_enter_id.require' => '未获取到进店方式ID',
        'enter_type.require' => '未获取到进店方式',
        'shop_order_id.require' => '请选择订单',
        'setting_price_range_id.require' => '请选择评论',
        'comment_status.require' => '请选择追评或发布评论',
        'comment_type.require' => '请选择评论方式',
        'mer_refund_status.require' => '请选择返款状态',
        'member_id.require' => '请重新登录',
        'actual_amount.require' => '请输入实付金额',
        'logistics_image_id.require' => '请上传物流截图',
        'member_account_id.require' => '请输入接单账号ID',
        'order_comment_id.require' => '未获取到追评任务信息，请刷新再试',
        'evaluate_image_id.require' => '请上传追评截图',
        'status.require' => '请选择订单状态',
        'object.require' => '请选择奖惩对象',
        'principal.require' => '请输入奖惩本金',
        'commission.require' => '请输入奖惩佣金',
        'shop_product_id.require' => '请选择商品',
    ];
    // 验证场景
    protected $scene = [
        'info'    =>  ['id'],
        'add'     =>  ['title', 'content', ],
        'edit'    =>  ['id', 'title', 'content', ],
        'edit1'    =>  ['id', 'actual_amount',],
        'dele'    =>  ['ids'],
        'urge'    =>  ['ids'],
        'shipping'=>  ['ids'],
        'disable' =>  ['ids', 'is_disable'],
        'auth' =>  ['ids', 'auth_status'],//审核
        'commentAuth' =>  ['ids', 'auth_status','comment_status'],//好评审核
        'merRefundAuth' =>  ['ids', 'mer_refund_status'],//商家返款审核
        'matchingOrder'=>  ['ids', 'member_account_ids'],//自选买号匹配订单
        'editKeyword'=>['shop_product_enter_id','enter_type'],//修改关键词或者二维码
        'addComment'=>['shop_order_id','setting_price_range_id','comment_status','comment_type'],//添加发布评论/追加评论
        'revokeComment'=>  ['ids','comment_status'],//撤销评论
        'cancelOrder'=>  ['id','member_id'],//取消订单
        'confirmOrder'=>  ['id','member_id'],//确认订单
        'answerVerify'=>  ['id','member_id'],//店铺或宝贝详情验证
        'submitScreenshot'=>  ['id','logistics_image_id'],//订单截图提交
        'is_appoint'=>  ['ids','member_account_id'],//批量指定买号
        'submitCommentScreenshot'=>  ['id','order_comment_id','evaluate_image_id'],//订单追评截图提交
        'revoke'=>['ids'],
        'edit_status'=>['id','status'],
        'edit_rewards'=>['shop_order_id','object','principal','commission'],
        'allocationOrder'=>['shop_product_id','member_id'],
        'grabOrder'=>['member_account_id','shop_order_id','member_id'],
    ];
}
